global using Microsoft.AspNetCore.Mvc;
global using Microsoft.AspNetCore.Mvc.RazorPages;

namespace WXWorkSvc.Third.Pages.Account;

public class LoginModel : PageModel
{
    public IActionResult OnGet([FromServices] WXWork3rd wx, string? returnUrl)
    {
        if (!string.IsNullOrEmpty(returnUrl))
            TempData["ReturnUrl"] = returnUrl;
        var state = Guid.NewGuid().ToString().Replace("-", "");
        TempData["State"] = state;
        return Redirect(wx.GetOAuthUrl(Request, state));

    }
}
